* OPEN STATA OUTPUT FILE LOG *


*log using "C:\Users\gk57526\Dropbox\Confirmation Dynamics Project (Jason Byers)\Confirmation Delay & Senate Committees\2023 Version\Fall 2024\Statistics\Output\Committee Delay.MANUSCRIPT RESULTS.smcl", replace

log using "/Users/jasonbyers/Dropbox/Jason Byers/Co-Authored Projects/Projects with George Krause/Krause Projects/Confirmation Dynamics Project/Confirmation Delay & Senate Committees/2023 Version/Fall 2024/Statistics/Output/Committee Delay.MANUSCRIPT RESULTS.smcl", replace

  
  
**** JSB UPDATED DATABASE: ADDING EXECUTIVE NOMINATION POSITIONS COVERED IN OSTRANDER DATABASE FROM MAY 2012 THROUGH DECEMBER 2020 AND UPDATING ALL OTHER DATA [SUMMER\FALL 2023]: /// 
*** ADDITIONAL VARIABLES ADDED IN MARCH 2024 IN RESPSONSE TO LSQ REFEREE REPORTS ****



**** "EXECUTIVE DEFERENCE OR LEGISLATIVE CONSTRAINT? COMMITTEE FOUNDATIONS OF CONFIRMATION DELAY FOR U.S. EXECUTIVE BRANCH APPOINTMENTS" [KRAUSE & BYERS] ****

 

   
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
   
   
 
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
*****************************************************************************************************************************************************************************************
******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


*** DEPENDENT VARIABLE:         legvet2 / legvetdur2plus1 = legvet2+1 [ENSURE NONZERO VALUES FOR DURATION OUTCOME VARIABLE]




*** PRIMARY COVARIATES/MODELS:  MODEL 1 [COX]:  committee_pres1  sendivide  committee_pres1 * sendivide  [CONTROLS, PLUS COMMITTEE & PRESIDENTIAL ADMINISTRATION UNIT EFFECTS]                             
                 
***                             MODEL 2 [COX]:  chair_pres1  sendivide   chair_pres1 * sendivide  [CONTROLS, PLUS COMMITTEE & PRESIDENTIAL ADMINISTRATION UNIT EFFECTS]    

***                             MODEL 3 [WEIBULL]:  committee_pres1  sendivide  committee_pres1 * sendivide  [CONTROLS, PLUS COMMITTEE & PRESIDENTIAL ADMINISTRATION UNIT EFFECTS]          
             
***                             MODEL 4 [WEIBULL]:  chair_pres1  sendivide   chair_pres1 * sendivide  [CONTROLS, PLUS COMMITTEE & PRESIDENTIAL ADMINISTRATION UNIT EFFECTS] 


**************************************************************************************************************************************************************************************** **************************************************************************************************************************************************************************************** *************************************************************************************************************************************************************************************** ****************************************************************************************************************************************************************************************
			  			  
			  
  
*** COMMITTEE CONTROL COVARIATES:       experience_median [MODELS 1 & 3] / chair_experience_1 [MODELS 2 & 4]; ///
***										ln_combills_workload; committeestaffsize [# Committee Staff]   
    
*** OSTRANDER CONTROL COVARIATES:       sendivide  polarization pres_app_m first90 preselection lameduck workload [Executive Civilian Nominations: Senate] 
***										female priorconfirm _Itier_2 _Itier_3 _Itier_4 defense infrastructure social


*** ADDITIONAL CONTROL COVARIATES:      pressenfloorabsdist [-] [|Senate Floor Median - President|]; kv_workload (# civilian executive nominations made in a given year/session)	
***										denied [-] [nominee previously denied in same Congress]; fvra [+] [= 1 if subject to FVRA 1998, = 0 otherwise]; 
***										firstrecess[-] [= 1 is nominated in July or August affected by August Recess, = 0 otherwise]; 
*** 									secondrecess [-] [= 1 is nominated in November or December affected by December Recess, = 0 otherwise]; major policy agency binary indicator [-];                      
***                                     committee-level & pressidential administration unit/fixed effects.
                                        
                                
							
 
 
   ******  NOTE: PRIVIELGED NOMINATIONS (N = 244) ARE EXCLUDED SINCE THEY BYPASS THE NORMAL SENATE CONFIRMATION PROCESS [INCLUDING COMMITTEE VETTING] -- 
   ******        THESE APPEAR AS MISSING VALUES FOR "legvet2" COMMITTEE CONFIRMATION DURATION VARIABLE


   ******       [UNCENSORED SUBSAMPLE==CONFIRMED IN CURRENT CONGRESS: N = 7,076 [71.63%] + CENSORED SUBSAMPLE==UNCONFIRMED IN CURRENT CONGRESS: N = 2,803 [28.37%] 
   ******       TOTAL EFFECTIVE SAMPLE = 9,879] **** 
   
	   
	   
	   
	   
	   
	   
	   
**** ESTIMATION STRATEGY: COX SEMIPARAMETIC REGRESSION [NONPARAMETRIC HAZARD] ****	   
	   
	   
	   
	   
	   
	   
	   
  
 * OPEN UPDATED "CONFIRMATION DELAY & SENATE COMMITTEES PROJECT" BASE DATABASE [12-17-2024] *
 
 
*use "C:\Users\gk57526\Dropbox\Confirmation Dynamics Project (Jason Byers)\Confirmation Delay & Senate Committees\2023 Version\Fall 2024\Statistics\Data\Krause and Byers Data (12.17.2024).dta", replace

use "/Users/jasonbyers/Dropbox/Jason Byers/Co-Authored Projects/Projects with George Krause/Krause Projects/Confirmation Dynamics Project/Confirmation Delay & Senate Committees/2023 Version/Fall 2024/Statistics/Data/Krause and Byers Data (12.17.2024).dta", replace



***************************************************************************************************************************

encode agency, generate(agency_id)



**** CREATE MAJOR POLICY AGENCY BINARY INDICATOR [= 1 FOR MAJOR POLICY-RELATED AGENCIES; = 0 OTHERWISE -- E.G., MINOR COMMISSIONS, COUNCILS, ADVISORY GROUPS, ETC......]

 
generate policy_majagency = 1 if agency_id>=1 & agency_id<=2 | agency_id==5 | agency_id==12 | agency_id>=32 & agency_id<=34 | agency_id>=36 & agency_id<=39 | agency_id==41 | agency_id>=43 & agency_id<=45 | agency_id>=50 & agency_id<=51 | agency_id==54 | agency_id >=57 & agency_id<=59 | agency_id==62 | agency_id>=64 & agency_id<=83 | agency_id>=85 & agency_id<=87 | agency_id>=90 & agency_id<=94 | agency_id==96 | agency_id>=98 & agency_id<=104 | agency_id>=106 & agency_id<=107 | agency_id>=110 & agency_id<=112 |  agency_id>=114 & agency_id<=127 | agency_id>=130 & agency_id<=131 | agency_id==136 | agency_id>=146 & agency_id<=148 | agency_id>=150 & agency_id<=152 | agency_id==155 | agency_id>=167 & agency_id<=168 | agency_id==186 | agency_id>=194 & agency_id<=195 | agency_id>=199 & agency_id<=203 | agency_id==205 | agency_id>=208 & agency_id<=222 | agency_id>=226 & agency_id<=227 |agency_id==232 | agency_id>=234 & agency_id<=235 | agency_id>=245 & agency_id<=246 | agency_id>=253 | agency_id==255 | agency_id==260 | agency_id==269 | agency_id==271 | agency_id==274|  agency_id>=277 & agency_id<=279
*
replace policy_majagency = 0 if policy_majagency==.

******************************************************************************************************************************************************************************************************************************************************

*FIGURES 1 & 2*

generate legvetdur2plus1 = legvet2+1

stset legvetdur2plus1, failure(confirmbinary)

quietly streg   committee_pres1  chair_pres1     sendivide    kv_workload   chair_experience_1  committeestaffsize polarization pres_app_m first90 preselection lameduck workload  female priorconfirm x_itier_2 x_itier_3 x_itier_4 defense infrastructure social   experience_median  fvra firstrecess secondrecess policy_majagency ln_combills_workload i.kbcom_1, distribution(weibull) vce(cluster kbcom_1)




*Figure 1 Boxplot (Overall)*

drop if kbcom_1 == 21

graph hbox legvetdur2plus1 if e(sample), over(kbcom_1, relabel(1 "Agriculture, Nutrition, and Forestry" 2 "Armed Services" 3 "Banking, Housing, and Urban Affairs" 4 "Budget" 5 "Commerce, Science, and Transportation" 6 "Energy and Natural Resources" 7 "Environment and Public Works" 8 "Finance" 9 "Foreign Relations" 10 "Governmental Affairs" 11 "Health, Education, Labor, and Pensions" 12 "Homeland Security and Government Affairs" 13 "Indian Affairs" 14 "Intelligence" 15 "Judiciary" 16 "Labor and Human Resources" 17 "Rules and Administration" 18 "Small Business" 19 "Small Business and Entrepreneurship" 20 "Veterans' Affairs") label(labsize(small))) nooutside ///
ylabel(0(50)500, nogrid labsize(small)) ///
note("") ///
ytitle("Duration of Committee Deliberation", size(small) margin(t=2)) ///
title("FIGURE 1: Box-Whisker Plots of Committee" "Confirmation Delay by Senate Committee", size(small))

graph save "Graph" "/Users/jasonbyers/Dropbox/Jason Byers/Co-Authored Projects/Projects with George Krause/Krause Projects/Confirmation Dynamics Project/Confirmation Delay & Senate Committees/2023 Version/Fall 2024/Statistics/Graphics/Manuscript/Figure1.gph", replace







*Figure 2 Boxplot (Unified versus Divided Control of Executive Appointment Process) *

stset legvetdur2plus1, failure(confirmbinary)

quietly streg   committee_pres1  chair_pres1     sendivide    kv_workload   chair_experience_1  committeestaffsize polarization pres_app_m first90 preselection lameduck workload  female priorconfirm x_itier_2 x_itier_3 x_itier_4 defense infrastructure social   experience_median  fvra firstrecess secondrecess policy_majagency ln_combills_workload i.kbcom_1, distribution(weibull) vce(cluster kbcom_1)


*figure 2 boxplot

*divided 
gen dpg_min = .
gen dpg_p1  = .
gen dpg_p5  = .
gen dpg_p10 = .
gen dpg_p25 = .
gen dpg_p50 = .
gen dpg_p75 = .
gen dpg_p90 = .
gen dpg_p95 = .
gen dpg_p99 = .
gen dpg_max = .


*unified
gen upg_min = .
gen upg_p1  = .
gen upg_p5  = .
gen upg_p10 = .
gen upg_p25 = .
gen upg_p50 = .
gen upg_p75 = .
gen upg_p90 = .
gen upg_p95 = .
gen upg_p99 = .
gen upg_max = .


*difference
gen commdelay_dpc_upc_min = .
gen commdelay_dpc_upc_p1 = .
gen commdelay_dpc_upc_p5 = .
gen commdelay_dpc_upc_p10 = .
gen commdelay_dpc_upc_p25 = .
gen commdelay_dpc_upc_p50 = .
gen commdelay_dpc_upc_p75 = .
gen commdelay_dpc_upc_p90 = .
gen commdelay_dpc_upc_p95 = .
gen commdelay_dpc_upc_p99 = .
gen commdelay_dpc_upc_max = .


levelsof kbcom_1, local(committees)

foreach c in `committees' {
	
	*divided statistics
    quietly summarize legvetdur2plus1 if e(sample) & sendivide == 1 & kbcom_1 == `c', detail
    replace dpg_min  = r(min)  if kbcom_1 == `c'
	replace dpg_p1   = r(p1)   if kbcom_1 == `c'
	replace dpg_p5   = r(p5)   if kbcom_1 == `c'
	replace dpg_p10  = r(p10)  if kbcom_1 == `c'
	replace dpg_p25  = r(p25)  if kbcom_1 == `c'
	replace dpg_p50  = r(p50)  if kbcom_1 == `c'
	replace dpg_p75  = r(p75)  if kbcom_1 == `c'
	replace dpg_p90  = r(p90)  if kbcom_1 == `c'
	replace dpg_p95  = r(p95)  if kbcom_1 == `c'
	replace dpg_p99  = r(p99)  if kbcom_1 == `c'
	replace dpg_max  = r(max)  if kbcom_1 == `c'
	
	*unified statistics
	quietly summarize legvetdur2plus1 if e(sample) & sendivide == 0 & kbcom_1 == `c', detail
    replace upg_min  = r(min)  if kbcom_1 == `c'
	replace upg_p1   = r(p1)   if kbcom_1 == `c'
	replace upg_p5   = r(p5)   if kbcom_1 == `c'
	replace upg_p10  = r(p10)  if kbcom_1 == `c'
	replace upg_p25  = r(p25)  if kbcom_1 == `c'
	replace upg_p50  = r(p50)  if kbcom_1 == `c'
	replace upg_p75  = r(p75)  if kbcom_1 == `c'
	replace upg_p90  = r(p90)  if kbcom_1 == `c'
	replace upg_p95  = r(p95)  if kbcom_1 == `c'
	replace upg_p99  = r(p99)  if kbcom_1 == `c'
	replace upg_max  = r(max)  if kbcom_1 == `c'
	
	*committee difference
	replace commdelay_dpc_upc_min = dpg_min - upg_min if kbcom_1 == `c'
	replace commdelay_dpc_upc_p1  = dpg_p1 - upg_p1   if kbcom_1 == `c'
	replace commdelay_dpc_upc_p5  = dpg_p5 - upg_p5   if kbcom_1 == `c'
	replace commdelay_dpc_upc_p10 = dpg_p10 - upg_p10 if kbcom_1 == `c'
	replace commdelay_dpc_upc_p25 = dpg_p25 - upg_p25 if kbcom_1 == `c'
	replace commdelay_dpc_upc_p50 = dpg_p50 - upg_p50 if kbcom_1 == `c'
	replace commdelay_dpc_upc_p75 = dpg_p75 - upg_p75 if kbcom_1 == `c'
	replace commdelay_dpc_upc_p90 = dpg_p90 - upg_p90 if kbcom_1 == `c'
	replace commdelay_dpc_upc_p95 = dpg_p95 - upg_p95 if kbcom_1 == `c'
	replace commdelay_dpc_upc_p99 = dpg_p99 - upg_p99 if kbcom_1 == `c'
	replace commdelay_dpc_upc_max = dpg_max - upg_max if kbcom_1 == `c'
	
}

duplicates drop kbcom_1, force

reshape long commdelay_dpc_upc_, i(kbcom_1)  j(statistic min p1 p5 p10 p25 p50 p75 p90 p95 p99 max)


graph hbox commdelay_dpc_upc_, over(kbcom_1, relabel(1 "Agriculture, Nutrition, and Forestry" 2 "Armed Services" 3 "Banking, Housing, and Urban Affairs" 4 "Budget" 5 "Commerce, Science, and Transportation" 6 "Energy and Natural Resources" 7 "Environment and Public Works" 8 "Finance" 9 "Foreign Relations" 10 "Governmental Affairs" 11 "Health, Education, Labor, and Pensions" 12 "Homeland Security and Government Affairs" 13 "Indian Affairs" 14 "Intelligence" 15 "Judiciary" 16 "Labor and Human Resources" 17 "Rules and Administration" 18 "Small Business" 19 "Small Business and Entrepreneurship" 20 "Veterans' Affairs") label(labsize(small))) nooutside ///
ylabel(-200(100)500, nogrid labsize(small)) ///
note("") ///
ytitle("Duration of Committee Deliberation", size(small) margin(t=2)) ///
title("FIGURE 2: Box-Whisker Plots of the Difference in Committee" "Confirmation Delay by Senate Committee for Divided and Unified Government", size(small)) yline(0, lcolor(red%40) lpattern(dash)) xsize(6)


graph save "Graph" "/Users/jasonbyers/Dropbox/Jason Byers/Co-Authored Projects/Projects with George Krause/Krause Projects/Confirmation Dynamics Project/Confirmation Delay & Senate Committees/2023 Version/Fall 2024/Statistics/Graphics/Manuscript/Figure2.gph", replace






************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


use "/Users/jasonbyers/Dropbox/Jason Byers/Co-Authored Projects/Projects with George Krause/Krause Projects/Confirmation Dynamics Project/Confirmation Delay & Senate Committees/2023 Version/Fall 2024/Statistics/Data/Krause and Byers Data (12.17.2024).dta", replace


********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************


** Generate Descriptive Statistics on Committee Confirmation Delay Based on Regression Sample (Both Uncensored and Full Effective Samples)** 

sum legvet2 if e(sample) & confirmbinary==1, detail 
*
*
sum legvet2 if e(sample), detail 







**** CREATE NEW AGENCY IDENTIFIER FROM STRING VARIABLE ****


encode agency, generate(agency_id)



**** CREATE MAJOR POLICY AGENCY BINARY INDICATOR [= 1 FOR MAJOR POLICY-RELATED AGENCIES; = 0 OTHERWISE -- E.G., MINOR COMMISSIONS, COUNCILS, ADVISORY GROUPS, ETC......]

 
generate policy_majagency = 1 if agency_id>=1 & agency_id<=2 | agency_id==5 | agency_id==12 | agency_id>=32 & agency_id<=34 | agency_id>=36 & agency_id<=39 | agency_id==41 | agency_id>=43 & agency_id<=45 | agency_id>=50 & agency_id<=51 | agency_id==54 | agency_id >=57 & agency_id<=59 | agency_id==62 | agency_id>=64 & agency_id<=83 | agency_id>=85 & agency_id<=87 | agency_id>=90 & agency_id<=94 | agency_id==96 | agency_id>=98 & agency_id<=104 | agency_id>=106 & agency_id<=107 | agency_id>=110 & agency_id<=112 |  agency_id>=114 & agency_id<=127 | agency_id>=130 & agency_id<=131 | agency_id==136 | agency_id>=146 & agency_id<=148 | agency_id>=150 & agency_id<=152 | agency_id==155 | agency_id>=167 & agency_id<=168 | agency_id==186 | agency_id>=194 & agency_id<=195 | agency_id>=199 & agency_id<=203 | agency_id==205 | agency_id>=208 & agency_id<=222 | agency_id>=226 & agency_id<=227 |agency_id==232 | agency_id>=234 & agency_id<=235 | agency_id>=245 & agency_id<=246 | agency_id>=253 | agency_id==255 | agency_id==260 | agency_id==269 | agency_id==271 | agency_id==274|  agency_id>=277 & agency_id<=279
*
replace policy_majagency = 0 if policy_majagency==.
*
*
tab policy_majagency




*** CREATE OUTCOME DURATION VARIABLE AND SET SURVIVAL TIME FUNCTION [STSET] *** 


generate legvetdur2plus1 = legvet2+1
*
stset legvetdur2plus1, failure(confirmbinary)

*
*
*




******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************

*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************




*** COMPUTE DESCRIPTIVE STATISTICS FOR MAIN COVARIATES  ***

quietly stcox    committee_pres1  chair_pres1     sendivide   pressenfloorabsdist   experience_median  chair_experience_1  committeestaffsize ln_combills_workload   pres_app_m first90 preselection lameduck  workload  polarization kv_workload   female priorconfirm  denied  x_itier_2 x_itier_3 x_itier_4 defense infrastructure social    fvra firstrecess secondrecess policy_majagency  i.kbcom_1 i.presrev, vce(cluster kbcom_1)





*** COMPUTE WITHIN-COMMITTEE DESCRIPTIVE STATISTICS SINCE MODEL ESTIMATES ARE WITHIN-COMMITTEE EFFECTS [SENATE COMMITTEE MEDIAN or SENATE COMMITTEE CHAIR - PRESIDENT ABSOLUTE IDEOLOGICAL DIFFERENCE] *** 

* FIRST, 'quietly' obtain correct regression model sample *

quietly stcox    committee_pres1  chair_pres1     sendivide   pressenfloorabsdist   experience_median chair_experience_1  committeestaffsize ln_combills_workload   pres_app_m first90 preselection lameduck  workload  polarization kv_workload   female priorconfirm denied  x_itier_2 x_itier_3 x_itier_4 defense infrastructure social  fvra firstrecess secondrecess policy_majagency i.kbcom_1 i.presrev, vce(cluster kbcom_1)



* SECOND, compute within-committee descriptive statistics  for primary continuous covariates *

* calculate the committee/group-means *
egen bSenComm_committee_pres1 = mean(committee_pres1), by(kbcom_1)
egen bSenComm_chair_pres1 = mean(chair_pres1), by(kbcom_1)
*
*

* compute the within-committee deviations from the respective committee means *
gen wSenComm_committee_pres1 = committee_pres1 - bSenComm_committee_pres1
gen wSenComm_chair_pres1 =     chair_pres1     - bSenComm_chair_pres1
*
*
*

* compute descriptive statistics for overall measure and within-committee measure *
 
sum committee_pres1  wSenComm_committee_pres1 if e(sample), detail
*
sum chair_pres1  wSenComm_chair_pres1 if e(sample), detail
*
*



*save "C:\Users\gk57526\Dropbox\Confirmation Dynamics Project (Jason Byers)\Confirmation Delay & Senate Committees\2023 Version\Fall 2024\Statistics\Data\Committee Delay.MANUSCRIPT RESULTS.12-23-2024.dta", replace

save "/Users/jasonbyers/Dropbox/Jason Byers/Co-Authored Projects/Projects with George Krause/Krause Projects/Confirmation Dynamics Project/Confirmation Delay & Senate Committees/2023 Version/Fall 2024/Statistics/Data/Committee Delay.MANUSCRIPT RESULTS.12-23-2024.dta", replace


***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************
 




** SET UP DATA TO BE READ IN DURATION/SURVIVAL TIME FORM & CREATE REQUISITE INTERACTION VARIABLES TO BE USED IN EVALUATING SELECTIVE VETTING HYPOTHESIS **

stset legvetdur2plus1, failure(confirmbinary)

*
*
*
*


*** EVALUATING THE PARTISAN SELECTIVE VETTING HYPOTHESIS FOR EXECUTIVE NOMINATIONS [N = 9,879] ***




 
 
 
***  FIRST SET OF ANALYSES: COX SEMIPARAMETRIC MODEL ***





* SENATE COMMITTEE MEDIAN PREFERENCE DISTANCE & UNIFIED/DIVIDED PARTISAN CONTROL OF SENATE & PRESIDENCY [MODEL 1: COX SEMIPARAMETRIC MODEL] *

stcox   c.committee_pres1##i.sendivide   pressenfloorabsdist   experience_median  committeestaffsize ln_combills_workload   pres_app_m first90 preselection lameduck    kv_workload  polarization  workload      female priorconfirm denied  x_itier_2 x_itier_3 x_itier_4 defense infrastructure social fvra firstrecess secondrecess policy_majagency  i.kbcom_1  i.presrev,  vce(cluster kbcom_1)
*
estat ic
*
estimates store model1
estout model1, cells(b(star fmt(3)) se(par fmt(3))) eform


*
*

* DESCRIPTIVE STATISTICS FOR EACH PARTISAN CONTROL REGIME *
sum wSenComm_committee_pres1 if e(sample) & sendivide==0, detail
sum wSenComm_committee_pres1 if e(sample) & sendivide==1, detail

** CONDITIONAL COEFFICIENT ANALYSIS TESTS: DIRECTION [+] ** 

* DIFFERENCE BETWEEN DIVIDED AND UNIFIED PARTISAN CONTROL OF SENATE & PRESIDENCY: INTERQUARTILE UNIT CHANGE IN "wSenComm_committee_pres1"  *
lincomest (committee_pres1 * 0.303 +  1.sendivide#c.committee_pres1 * 0.2483547) - committee_pres1 * 0.303, eform(hr)
matrix model1 = r(table)
mat list model1


*
*
*




** STORE FINAL SET OF RESULTS FOR FIGURE 2 BELOW ****










****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************

  


* SENATE COMMITTEE CHAIR PREFERENCE DISTANCE & UNIFIED/DIVIDED PARTISAN CONTROL OF SENATE & PRESIDENCY [MODEL 2: COX SEMIPARAMETRIC MODEL] *


stcox   c.chair_pres1##i.sendivide   pressenfloorabsdist  chair_experience_1  committeestaffsize ln_combills_workload   pres_app_m first90 preselection lameduck    kv_workload  polarization  workload      female priorconfirm denied  x_itier_2 x_itier_3 x_itier_4 defense infrastructure social fvra firstrecess secondrecess policy_majagency  i.kbcom_1  i.presrev,  vce(cluster kbcom_1)
*
estat ic
*

estimates store model2
estout model2, cells(b(star fmt(3)) se(par fmt(3))) eform
*
*
* DESCRIPTIVE STATISTICS FOR EACH PARTISAN CONTROL REGIME *
sum wSenComm_chair_pres1 if e(sample) & sendivide==0, detail
sum wSenComm_chair_pres1 if e(sample) & sendivide==1, detail


** CONDITIONAL COEFFICIENT ANALYSIS TESTS: DIRECTION [+] ** 


* DIFFERENCE BETWEEN DIVIDED AND UNIFIED PARTISAN CONTROL OF SENATE & PRESIDENCY: INTERQUARTILE UNIT CHANGE IN "wSenComm_chair_pres1" *
lincomest (chair_pres1 * 0.2724212 +  1.sendivide#c.chair_pres1 * 0.2364347) - chair_pres1 * 0.2724212, eform(hr)
matrix model2 = r(table)
mat list model2
*
*
*
*
*


** STORE FINAL SET OF RESULTS FOR FIGURE 2 BELOW ****








****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************


 
 
 
***  SECOND SET OF ANALYSES: WEIBULL PARAMETRIC MODEL ***





*** EVALUATING THE PARTISAN SELECTIVE VETTING HYPOTHESIS FOR EXECUTIVE NOMINATIONS [N = 9,879] ***




* SENATE COMMITTEE MEDIAN PREFERENCE DISTANCE & UNIFIED/DIVIDED PARTISAN CONTROL OF SENATE & PRESIDENCY [MODEL 3: WEIBULL PARAMETRIC MODEL] *

streg   c.committee_pres1##i.sendivide  pressenfloorabsdist   experience_median  committeestaffsize ln_combills_workload   pres_app_m first90 preselection lameduck    kv_workload  polarization  workload      female priorconfirm denied  x_itier_2 x_itier_3 x_itier_4 defense infrastructure social fvra firstrecess secondrecess policy_majagency   i.kbcom_1 i.presrev, distribution(weibull) vce(cluster kbcom_1)
*
estat ic
*
estimates store model3
estout model3, cells(b(star fmt(3)) se(par fmt(3))) eform

*
*

** CONDITIONAL COEFFICIENT ANALYSIS TESTS: DIRECTION [+] ** 

* DIFFERENCE BETWEEN DIVIDED AND UNIFIED PARTISAN CONTROL OF SENATE & PRESIDENCY: INTERQUARTILE UNIT CHANGE IN "wSenComm_committee_pres1"  *
lincomest (committee_pres1 * 0.303 +  1.sendivide#c.committee_pres1 * 0.2483547) - committee_pres1 * 0.303, eform(hr)
matrix model3 = r(table)
mat list model3


*
*
*

**** COMPUTE DIFFERENTIAL MARGINAL MEDIAN SURVIVAL EFFECTS:DIFFERENCE BETWEEN DIVIDED AND UNIFIED PARTISAN CONTROL OF SENATE & PRESIDENCY: INTERQUARTILE UNIT CHANGE IN "wSenComm_committee_pres1"   *****

** Generate 'manual' interaction variable ** 
generate dpc_committee_pres1 = sendivide*committee_pres1


** Re-Estimate Model 3  with 'manual' interaction variable **
streg  committee_pres1 sendivide dpc_committee_pres1   pressenfloorabsdist   experience_median  committeestaffsize ln_combills_workload   pres_app_m first90 preselection lameduck   kv_workload  polarization   workload  female priorconfirm denied  x_itier_2 x_itier_3 x_itier_4 defense infrastructure social fvra firstrecess secondrecess policy_majagency i.kbcom_1 i.presrev, distribution(weibull) vce(cluster kbcom_1)
* 
** Generate Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on 25th Percentile & 75th Percentile Values of "wSenComm_committee_pres1" under Sendivide==1 (Divided Partisan Control) **
margins, predict(median time) at(dpc_committee_pres1=(0.0904305 0.3387852))
*
** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(dpc_committee_pres1=(0.0904305 0.3387852))  contrast(atcontrast(r))
matrix model3b = r(table)
mat list model3b
*
** Generate Descriptive Statistics on Committee Confirmation Delay Based on Regression Sample ** 
sum legvet2 if e(sample) & confirmbinary==1, detail 




** STORE FINAL SET OF RESULTS FOR FIGURES 2 & 3 BELOW ****




****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************







* SENATE COMMITTEE CHAIR PREFERENCE DISTANCE & UNIFIED/DIVIDED PARTISAN CONTROL OF SENATE & PRESIDENCY [MODEL 4: WEIBULL PARAMETRIC MODEL] *

streg   c.chair_pres1##i.sendivide  pressenfloorabsdist  chair_experience_1  committeestaffsize ln_combills_workload   pres_app_m first90 preselection lameduck    kv_workload  polarization  workload      female priorconfirm denied  x_itier_2 x_itier_3 x_itier_4 defense infrastructure social fvra firstrecess secondrecess policy_majagency  i.kbcom_1 i.presrev,  distribution(weibull) vce(cluster kbcom_1)
*
estat ic
*
*
estimates store model4
estout model4, cells(b(star fmt(3)) se(par fmt(3))) eform
*
*

** CONDITIONAL COEFFICIENT ANALYSIS TESTS: DIRECTION [+] ** 

* DIFFERENCE BETWEEN DIVIDED AND UNIFIED PARTISAN CONTROL OF SENATE & PRESIDENCY: INTERQUARTILE UNIT CHANGE IN "wSenComm_chair_pres1" *
lincomest (chair_pres1 * 0.2724212 +  1.sendivide#c.chair_pres1 * 0.2364347) - chair_pres1 * 0.2724212, eform(hr)
matrix model4 = r(table)
mat list model4
*
*
*
*
*

**** COMPUTE DIFFERENTIAL MARGINAL MEDIAN SURVIVAL EFFECTS:DIFFERENCE BETWEEN DIVIDED AND UNIFIED PARTISAN CONTROL OF SENATE & PRESIDENCY: INTERQUARTILE UNIT CHANGE IN "wSenComm_chair_pres1"   *****

** Generate 'manual' interaction variable ** 
generate dpc_chair_pres1 = sendivide*chair_pres1

** Re-Estimate Model 4  with 'manual' interaction variable **
streg   chair_pres1 sendivide dpc_chair_pres1  pressenfloorabsdist  chair_experience_1  committeestaffsize ln_combills_workload   pres_app_m first90 preselection lameduck    kv_workload  polarization  workload female priorconfirm denied  x_itier_2 x_itier_3 x_itier_4 defense infrastructure social fvra firstrecess secondrecess policy_majagency  i.kbcom_1 i.presrev, distribution(weibull) vce(cluster kbcom_1)
* 
** Generate Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on 25th Percentile & 75th Percentile Values of "wSenComm_chair_pres1" under Sendivide==1 (Divided Partisan Control) **
margins, predict(median time) at(dpc_chair_pres1=(0.2528486 0.4892833))
*
** Generate Differential Predicted Median Survival Time of Senate Committee Stage of Confirmation Process -- Based on Interquartile Differential [corresponding to Differential Marginal Hazard Ratio Estimates] **
margins, predict(median time) at(dpc_chair_pres1=(0.2528486 0.4892833))  contrast(atcontrast(r))
matrix model4b = r(table)
mat list model4b
*
** Generate Descriptive Statistics on Committee Confirmation Delay Based on Regression Sample ** 
sum legvet2 if e(sample) & confirmbinary==1, detail 




** STORE FINAL SET OF RESULTS FOR FIGURES 4 & 5 BELOW ****





****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************

**** FIGURE 4 ****

matrix A = J(4, 3, .)
matrix coln A = Point ll95 ul95
matrix rown A = 1 2 3 4

matrix A[1,1] = model1[1,1]
matrix A[1,2] = model1[5,1]
matrix A[1,3] = model1[6,1]

matrix A[2,1] = model2[1,1]
matrix A[2,2] = model2[5,1]
matrix A[2,3] = model2[6,1]

matrix A[3,1] = model3[1,1]
matrix A[3,2] = model3[5,1]
matrix A[3,3] = model3[6,1]

matrix A[4,1] = model4[1,1]
matrix A[4,2] = model4[5,1]
matrix A[4,3] = model4[6,1]


**********

coefplot (matrix(A[,1]), ci((2 3))), grid(none) xline(1, lcolor(red%40) lpattern(dash)) xtitle("Hazard Ratio", size(small) margin(t=2)) ylabel(1 "Model 1" 2 "Model 2" 3 "Model 3" 4 "Model 4", labsize(small) noticks) mlabel format(%9.3f) mlabposition(12) mlabsize(vsmall) xlabel(0(1)2, angle(0) labsize(small) format(%9.1f)) msymbol(o) mcolor(black) msize(small) title("FIGURE 4:", size(med)) ciopts(lcolor(black)) legend(off) subtitle("Differential Partisan Control Effects of Committee-President Ideological Distance", size(small))


*graph save "Graph" "C:\Users\gk57526\Dropbox\Confirmation Dynamics Project (Jason Byers)\Confirmation Delay & Senate Committees\2023 Version\Fall 2024\Statistics\Graphics\figure2.gph", replace

graph save "Graph" "/Users/jasonbyers/Dropbox/Jason Byers/Co-Authored Projects/Projects with George Krause/Krause Projects/Confirmation Dynamics Project/Confirmation Delay & Senate Committees/2023 Version/Fall 2024/Statistics/Graphics/Manuscript/Figure4.gph", replace



****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************

**** Figure 5 ****

matrix C = J(2, 3, .)
matrix coln C = Point ll95 ul95
matrix rown C = 1 2

matrix C[1,1] = model3b[1,1]
matrix C[1,2] = model3b[5,1]
matrix C[1,3] = model3b[6,1]

matrix C[2,1] = model4b[1,1]
matrix C[2,2] = model4b[5,1]
matrix C[2,3] = model4b[6,1]


**********

coefplot (matrix(C[,1]), ci((2 3))), grid(none) xline(0, lcolor(red%40) lpattern(dash)) xtitle("Number of Days", size(small) margin(t=2)) ylabel(1 "Model 3" 2 "Model 4", labsize(small) noticks) mlabel format(%9.0f)  mlabposition(12) mlabsize(vsmall) xlabel(-200(50)50, angle(0) labsize(small)) msymbol(o) mcolor(black) msize(small) title("FIGURE 5:", size(med)) ciopts(lcolor(black)) legend(off) subtitle("Differential Partisan Control Effects" "(Predicted Marginal Median Survival Day Differences)", size(small))

*graph save "Graph" "C:\Users\gk57526\Dropbox\Confirmation Dynamics Project (Jason Byers)\Confirmation Delay & Senate Committees\2023 Version\Fall 2024\Statistics\Graphics\figure5.gph", replace

graph save "Graph" "/Users/jasonbyers/Dropbox/Jason Byers/Co-Authored Projects/Projects with George Krause/Krause Projects/Confirmation Dynamics Project/Confirmation Delay & Senate Committees/2023 Version/Fall 2024/Statistics/Graphics/Manuscript/Figure5.gph", replace


****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************
****************************************************************************************************************************************************************************************



  


log close
